package com.javaoopfive.eat;

public class Master{

    public void Tw(Pet pet){
        pet.eatfood();
        if(pet instanceof Dog){
            Dog dog =(Dog)pet;
            dog.runFP();
        }else if(pet instanceof Penguin){
            Penguin penguin =(Penguin)pet;
            penguin.runYY();
        }
    }
}
